#!/usr/bin/env python
# vim:fileencoding=utf-8

from calibre.web.feeds.news import BasicNewsRecipe


class Osvita(BasicNewsRecipe):
    title = '\u041E\u0441\u0432\u0456\u0442\u0430.ua'
    __author__ = 'bugmen00t'
    description = '\u0423\u0441\u0435 \u043F\u0440\u043E \u043E\u0441\u0432\u0456\u0442\u0443 \u0432 \u0423\u043A\u0440\u0430\u0457\u043D\u0456 \u0442\u0430 \u0437\u0430 \u043A\u043E\u0440\u0434\u043E\u043D\u043E\u043C: \u0442\u0435\u043C\u0430\u0442\u0438\u0447\u043D\u0438\u0439 \u0440\u0435\u0441\u0443\u0440\u0441, \u043F\u0440\u0438\u0441\u0432\u044F\u0447\u0435\u043D\u0438\u0439 \u043E\u0441\u0432\u0456\u0442\u0456 \u0432 \u0423\u043A\u0440\u0430\u0457\u043D\u0456 \u0442\u0430 \u0437\u0430 \u0457\u0457 \u043C\u0435\u0436\u0430\u043C\u0438, \u0454 \u0430\u043A\u0442\u0443\u0430\u043B\u044C\u043D\u0438\u043C \u0434\u0436\u0435\u0440\u0435\u043B\u043E\u043C \u0456\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0456\u0457 \u0443 \u0446\u0456\u0439 \u0441\u0444\u0435\u0440\u0456.'  # noqa
    publisher = '\u041E\u0441\u0432\u0456\u0442\u0430.ua'
    category = 'blog'
    cover_url = u'http://osvita.ua/doc/i/Contacts-logo.jpg'
    language = 'uk'
    no_stylesheets = False
    remove_javascript = False
    auto_cleanup = False
    oldest_article = 7
    max_articles_per_feed = 30

    remove_tags_before = dict(name='div', attrs={'id': 'body'})

    remove_tags_after = dict(name='div', attrs={'id': 'body'})

    remove_tags = [
        # Unable to fetch images, removing them completely
        dict(name='img'),
        dict(name='p', attrs={'class': 'info'})
    ]

    feeds = [('\u041D\u043E\u0432\u0438\u043D\u0438', 'https://osvita.ua/rss/')]

    def print_version(self, url):
        return url + 'print'
